import Vue from 'vue'

// 2. 导入VueRouter
import VueRouter from 'vue-router'

// 导入页面
import DiscoveringMusic from "@/views/DiscoveringMusic.vue";
import MyMusic from "@/views/MyMusic.vue";
import FollowWithInterest  from "@/views/FollowWithInterest.vue";
import ShoppingMall from "@/views/ShoppingMall.vue";
import Musician from "@/views/Musician.vue";
import Download from "@/views/Download.vue";
import NotFound from "@/views/NotFound.vue";

// 3. 使用vue插件  vue的插件想要生效必须调用一个方法  Vue.use(XXXX)
Vue.use(VueRouter)

// 4. 创建一个路由对象
const router = new VueRouter({
    mode: 'history',
    routes: [
        {
            path: '/',
            redirect: '/discoveringMusic',
        },
        {
            path: '/discoveringMusic',
            component: DiscoveringMusic,
        },
        {
            path: '/myMusic',
            component: MyMusic,
        },
        {
            path: '/followWithInterest',
            component: FollowWithInterest,
        },
        {
            path: '/shoppingMall',
            component: ShoppingMall,
        },
        {
       
            path: '/musician',
            component: Musician,
        },
        {
            path: '/download',
            component: Download,
        },
        {
            path: '*',
            component: NotFound,
        },
    ]
})

export default router